import { _decorator, Component, director, EventMouse, Node, Sprite } from "cc";
import { BaseTriggerManager } from "./base-trigger-manager";
import { DataManager } from "../runtime/data-manager";
const { ccclass, property } = _decorator;

@ccclass("DoorTriggerManager")
export class DoorTriggerManager extends BaseTriggerManager {
  handlerTrigger(event: EventMouse): void {
    if (DataManager.Instance.h2aResoleved) {
      director.loadScene("H3");
    } else {
      director.loadScene("H2A");
    }
  }

  render() {
    this.getComponent(Sprite).enabled = !DataManager.Instance.h2aResoleved;
  }
}
